1. Field of the Invention
The present invention relates to a rendering method and a rendering apparatus where an image is rendered on a two-dimensional screen such as a television monitor or the like, to a computer-readable recording medium on which a rendering program executed by a computer is recorded, a program processor for executing a rendering program, and a rendering program executed by a computer.
2. Description of the Related Art
Recently, for a television game machine or a personal computer, such as high integration and high speed of a processor and a memory has been performed. As a result, for example, it is possible to generate a three-dimensional image having a sense of presence and depth in real time, and to render the image on a two-dimensional monitor screen.
In the case of rendering a three-dimensional image on the two-dimensional monitor screen, geometry processing such as a coordinate transformation processing, a clipping processing, a lighting processing are performed on three-dimensional polygon data, and as a result, data obtained from the result of the above processing is subjected to perspective projection transformation.
Now, in the case of rendering the three-dimensional image on the two-dimensional monitor screen, for example, as shown in FIG. 1, there is a case where a certain object A exists in a visual field (frame F) from a virtual viewpoint, and further, another object B exists between the object A and the above virtual viewpoint. In this case, an image when viewing from the virtual viewpoint looks like an image such that the object A is partially shielded by the object B.
As this example, in a case that a positional relationship appears such that the object B exists between the virtual viewpoint and the object A, for allowing the object A to be viewed from the above virtual viewpoint, the object B may be rendered to be semitransparent, for example, as shown in FIG. 2. In other words, the object B is rendered in a state of being semitransparent, and thereby, in a portion ab where the object B overlaps with the object A, it is possible to see the object A through the semitransparent object B.
In a conventional rendering apparatus, in the case of rendering the image as shown in FIG. 2, first, as a first process, whether or not another body (object or the like) exists between the virtual viewpoint and the object A is determined in advance. In this first process, it is recognized that the object B exists in the example shown in FIG. 2. Subsequently, as a second process, the object B is rendered to be semitransparent.
The conventional rendering apparatus carries out the first and second processes, and thereby, renders an image such that the object A is seen from the virtual viewpoint even if a positional relationship appears such that the object B exists between the virtual viewpoint and the object A.
However, in order to carry out a determination process such as the above first process, there is a need of making a great many of operations for calculating a distance between the virtual viewpoint and each of the objects A and B. For this reason, a long processing time is required. Therefore, for example, in the case of rendering a three-dimensional image comprising a great many of objects in real time, the image processing is not fully performed. As a result, there is a possibility that the three dimensional image is incorrectly or incompletely rendered.
For example, in this case where the rendering apparatus is equipped with a very high speed computable CPU (Central Processing Unit), it is possible to shorten the time spent for the above determination process. However, the very high speed computable CPU is expensive. For this reason, there is a problem of increasing a cost of the rendering apparatus.
Moreover, the above second process, that is, semi-transparency processing is generally carried out at a unit of polygon. Therefore, for example, in the case where the object A is significantly smaller than the object B, a problem occurs such that a portion that should not be made semitransparent becomes semitransparent in the object B. As described above, when a portion that should not be made semitransparent becomes semitransparent, for example, other objects and the like are transparent. Therefore, the images are unnatural and significantly having trouble seeing.